package com.heima.comment.controller.v1;

import com.heima.model.comment.dtos.CommentRepayDto;
import com.heima.model.comment.dtos.CommentRepayLikeDto;
import com.heima.model.comment.dtos.RepayCommentDto;
import com.heima.comment.service.CommentService;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/comment_repay")
public class RepayCommentController {

    @Autowired
    private CommentService commentService;
    /**
     * @Description:     回复评论
     * @Date 2023/6/28 15:03
     * @Author  朱传洋
     */
    @PostMapping("save")
    public ResponseResult repayComment(@RequestBody RepayCommentDto dto){
        return commentService.replyComment(dto);
    }

    /**
     * @Description:     查询评论回复列表
     * @Date 2023/6/28 15:04
     * @Author  朱传洋
     */
    @PostMapping("load")
    public ResponseResult loadRepayComment(@RequestBody CommentRepayDto dto){
        return commentService.loadRepayComment(dto);
    }

    /**
     * @Description:  点赞回复的评论
     * @Date 2023/6/28 15:09
     * @Author  朱传洋
     */
    @PostMapping("like")
    public ResponseResult likeRepayComment(@RequestBody CommentRepayLikeDto dto){
        return commentService.likeRepayComment(dto);
    }
}